package com.mvc.controller;

import com.alibaba.fastjson.JSONObject;
import com.net.server.ConnectManager;
import com.pojo.ClientRunTimeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName DispatchController
 * @Description TODO
 * @Author zhuchen216628
 * @Date 2018/9/29 11:09
 * @Version 1.0
 **/
@Controller
@RequestMapping("/dispatch")
public class DispatchController {

    public DispatchController(){
        System.out.println(1);
    }

    @Autowired
    private ConnectManager connectManager;

    @ResponseBody
    @RequestMapping("/getipport")
    public JSONObject getIpPort() {
        ClientRunTimeInfo clientRunTimeInfo = connectManager.chooseDevice();

        JSONObject obj = new JSONObject();
        obj.put("ip","127.0.0.1");
        obj.put("port","7891");
        return obj;
    }
}
